package com.gitee.huanminabc.db_freedom.segments;

import com.gitee.huanminabc.db_freedom.utils.SqlFunction;

/**
 * 函数实现类
 * @param <T>
 * @param <Children>
 */
public abstract class SqlFunImplSegments<T, Children extends SqlConditionImplSegments<T, Children>>    extends SqlConditionImplSegments<T, Children> implements SqlFunSegments<Children, T, SqlFunction<T, ?>> {
    public SqlFunImplSegments() {
    }
    public SqlFunImplSegments(Class<?> entityClass, com.gitee.huanminabc.db_freedom.wrapper.SQL sql) {
        super(entityClass, sql);
    }

    //让继承的自己实现后续的结构这里只是一个模板
    @Override
    public Children SUM() {
        SQL().append(" SUM");
        return typedThis;
    }

    @Override
    public Children AVG() {
        SQL().append(" AVG");
        return typedThis;
    }

    @Override
    public Children MAX() {
        SQL().append(" MAX");
        return typedThis;
    }

    @Override
    public Children MIN() {
        SQL().append(" MIN");
        return typedThis;
    }

    @Override
    public Children COUNT() {
        SQL().append(" COUNT");
        return typedThis;
    }
}
